<template>
  <div>
    <Form :validOnChange="true" :model="model">
      <FormItem label="保存路径" v-show="nodeType == 'FILE_SAVE' || nodeType == 'FILE_MOVE'">
        <input v-model="model.savePath" type="text" />
      </FormItem>
      <FormItem label="文件目录" v-show="nodeType == 'FILE_DELETE' || nodeType == 'FILE_READ' || nodeType == 'FILE_MOVE'">
        <input v-model="model.filePath" type="text" />
      </FormItem>
    </Form>
    <div slot="footer">
      <Button :block="true" text-color="primary" @click="save">确认</Button>
    </div>
    <br />
    <Row>
      <div>
        <div class="text-left bottom-line" style="font-size:8px;padding:5px;" v-show="nodeType == 'FILE_SAVE'">
          <span class="primary-color">sourceFile</span>&nbsp;&nbsp;<span>文件数据，上传时不指定，子流程中获取时参数中设置</span>
        </div>
        <div class="text-left bottom-line" style="font-size:8px;padding:5px;" v-show="nodeType == 'FILE_MOVE'">
          <span class="primary-color">moveFileName</span>&nbsp;&nbsp;<span>移动文件名，在参数中设置</span>
        </div>
        <div class="text-left bottom-line" style="font-size:8px;padding:5px;" v-show="nodeType == 'FILE_DELETE'">
          <span class="primary-color">deleteFileName</span>&nbsp;&nbsp;<span>删除文件名，在参数中设置</span>
        </div>
        <div class="text-left bottom-line" style="font-size:8px;padding:5px;" v-show="nodeType == 'FILE_READ'">
          <span class="primary-color">readFileName</span>&nbsp;&nbsp;<span>读取文件名，在参数中设置</span>
        </div>
      </div>
    </Row>
  </div>
</template>
<script>
export default {
  data() {
    return {
      nodeType: "",
      model: {
        successCode: "",
        dataKey: "",
      },
      param: {
        keyName: "keyId",
        titleName: "title",
      },
    };
  },
  methods: {
    fileInit(data, nodeType) {
      this.nodeType = nodeType;
      if (!!data) {
        this.model = data;
      }
    },
    save() {
      console.log(this.model);
      this.$emit("setContent", this.model);
    },
  },
  deactivated() {
    this.$destroy(true);
  },
};
</script>
